<?Lassoscript
// Last modified 4/17/09 by Eric Landmann

// CHANGE NOTES
// 4/17/09
// Version 1.0

// FUNCTIONALITY
// This routine checks all the post names to see if the member is allowed to post

// Post_Name1
Var:'SQL_Query_Members1' = 'SELECT ID,Post_Name1,Allow from ' $svMembersTable ' WHERE Post_Name1 = "' $vPoster '" LIMIT 1';
Inline: -Search, -Database=$svSiteDatabase, -Table=$svMembersTable,
	-Username=$svSiteUsername, -Password=$svSitePassword,
	-SQL=$SQL_Query_Members1;
	If: (Found_Count) != 0;
		If: (Field:'Allow') == 'Y';
			Var:'Denied' = 'No';
		/If;
	/If;
/Inline;

// Post_Name2
Var:'SQL_Query_Members2' = 'SELECT ID,Post_Name2,Allow from ' $svMembersTable ' WHERE Post_Name2 = "' $vPoster '" LIMIT 1';
Inline: -Search, -Database=$svSiteDatabase, -Table=$svMembersTable,
	-Username=$svSiteUsername, -Password=$svSitePassword,
	-SQL=$SQL_Query_Members2;
	If: (Field:'Allow') == 'Y';
		Var:'Denied' = 'No';
	/If;
/Inline;

// Post_Name3
Var:'SQL_Query_Members3' = 'SELECT ID,Post_Name3,Allow from ' $svMembersTable ' WHERE Post_Name3 = "' $vPoster '" LIMIT 1';
Inline: -Search, -Database=$svSiteDatabase, -Table=$svMembersTable,
	-Username=$svSiteUsername, -Password=$svSitePassword,
	-SQL=$SQL_Query_Members3;
	If: (Field:'Allow') == 'Y';
		Var:'Denied' = 'No';
	/If;
/Inline;

// Post_Name4
Var:'SQL_Query_Members4' = 'SELECT ID,Post_Name4,Allow from ' $svMembersTable ' WHERE Post_Name4 = "' $vPoster '" LIMIT 1';
Inline: -Search, -Database=$svSiteDatabase, -Table=$svMembersTable,
	-Username=$svSiteUsername, -Password=$svSitePassword,
	-SQL=$SQL_Query_Members4;
	If: (Field:'Allow') == 'Y';
		Var:'Denied' = 'No';
	/If;
/Inline;

// Post_Name5
Var:'SQL_Query_Members5' = 'SELECT ID,Post_Name5,Allow from ' $svMembersTable ' WHERE Post_Name5 = "' $vPoster '" LIMIT 1';
Inline: -Search, -Database=$svSiteDatabase, -Table=$svMembersTable,
	-Username=$svSiteUsername, -Password=$svSitePassword,
	-SQL=$SQL_Query_Members5;
	If: (Field:'Allow') == 'Y';
		Var:'Denied' = 'No';
	/If;
/Inline;

Debug;
	'SQL_Query_Members1 = ' $SQL_Query_Members1 '<br>\n';
	'SQL_Query_Members2 = ' $SQL_Query_Members2 '<br>\n';
	'SQL_Query_Members3 = ' $SQL_Query_Members3 '<br>\n';
	'SQL_Query_Members4 = ' $SQL_Query_Members4 '<br>\n';
	'SQL_Query_Members5 = ' $SQL_Query_Members5 '<br>\n';
	'Denied = ' $Denied '<br>\n';
	'Error = ' (Error_CurrentError) '<br>\n';
/Debug;
?>
